package java_thinking.unit_11._11_4;

import java.util.*;

/**
 * @Description :
 * @author: cww
 * @DateTime: 2019-03-17 15:54
 */

public class E4 {
}

class Generator {
    int key = 0;
    public String next() {
        switch (key){
            case 0: key++;return "Snow White";
            case 1 : key++; return "Bashful";
            case 2 : key++; return "Doc";
            case 3 : key++; return "Dopey";
            case 4 : key++; return "Grumpy";
            case 5 : key++; return "Happy";
            case 6 : key++; return "Sleepy";
            case 7 : key = 0; return "Sneezy";
            default: return "";
        }
    }
    public void fillA(String[] a){
        for (int i =0;i<a.length;i++){
            a[i] = next();
        }
    }
    public Collection fill(Collection<String> c,int n){
        for (int i=0;i<n;i++){
            c.add(next());
        }
        return c;
    }

    public static void main(String[] args) {
        Generator generator = new Generator();
        String[] a = new String[10];
        generator.fillA(a);
        for (String s:a){
            System.out.print(s+", ");
        }
        System.out.println(generator.fill(new ArrayList<String>(),10));
        System.out.println(generator.fill(new LinkedList<String>(),10));
        System.out.println(generator.fill(new HashSet<String>(),10));
        System.out.println(generator.fill(new LinkedHashSet<String>(),10));
        System.out.println(generator.fill(new TreeSet<String>(),10));
    }
}